package com.spring.dynamicdatasource.dto;

import com.spring.dynamicdatasource.enums.DatabaseType;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author HouKunLin
 * @date 19-9-9 下午11:07
 */
public class ConnectionDTO implements Serializable {
    @NotBlank(message = "主机不能为空")
    private String host;
    @NotBlank(message = "端口不能为空")
    private String port;
    @NotBlank(message = "数据库名称不能为空")
    private String database;
    @NotBlank(message = "用户名不能为空")
    private String username;
    @NotBlank(message = "密码不能为空")
    private String password;
    private DatabaseType type;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public DatabaseType getType() {
        return type;
    }

    public void setType(DatabaseType type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "ConnectionDTO{" +
                "host='" + host + '\'' +
                ", port='" + port + '\'' +
                ", database='" + database + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}
